package com.icinfo.cloud.provider.punish.coordination.lawjoin.controller;

import com.icinfo.cloud.provider.punish.coordination.lawjoin.dto.EditCaseStatusDto;
import com.icinfo.cloud.provider.punish.coordination.lawjoin.service.ILawJoinService;
import com.icinfo.framework.common.web.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/punish/coordination/lawJoin")
public class LawJoinController {
    @Autowired
    private ILawJoinService lawJoinService;
    /**
     *根据两法回调状态修改案件状态
     * @author liyafeng
     * @date 2022/9/29
      * @param dto
     * @return {@link Result< String>}
     */
    @PostMapping("/editCaseStatusByLawJoinCallBack")
    public Result<String> editCaseStatusByLawJoinCallBack(@RequestBody @Validated EditCaseStatusDto dto){
        int num=lawJoinService.editCaseStatusByLawJoinCallBack(dto);
        if(num>0){
            return Result.success("变更成功");
        }
        return Result.error("变更失败");
    }
}
